package com.xcity.pomelo.response;

import java.util.ArrayList;
import java.util.List;

import com.xcity.game.common.EasyItemInfo;
import com.xcity.game.map.template.MineTypeTemplate;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class MineGetRewardResponse extends Response {
	private int money;
	private List<EasyItemInfo> itemList;
	public MineGetRewardResponse(int serial, MineTypeTemplate temp, int count) {
		super(serial);
		if(temp.getProduceGold() > 0){
			money = temp.getProduceGold() * count;
		}
		itemList = new ArrayList<EasyItemInfo>();
		for(int i = 0, size = temp.getProduceItem().length; i < size; i++){
			if(temp.getProduceItem()[i] > 0 && temp.getProduceItemCount()[i] > 0){
				itemList.add(new EasyItemInfo(temp.getProduceItem()[i], temp.getProduceItemCount()[i] * count));
			}
		}
	}
	public int getMoney() {
		return money;
	}
	public void setMoney(int money) {
		this.money = money;
	}
	public List<EasyItemInfo> getItemList() {
		return itemList;
	}
	public void setItemList(List<EasyItemInfo> itemList) {
		this.itemList = itemList;
	}
}
